﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Edit.Master"  AutoEventWireup="true"  CodeBehind="BD_Contract_Edit.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Contract.BD_Contract_Edit"  %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<script language="javascript" type="text/javascript" src="../../Apply/SelectOu.js"></script>
	<script language="javascript" type="text/javascript">
	    function SelectContractor() {
	        var retValue = SelectOu('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>', '<%=((int)Honestysoft.Baseframework.Model.EnumItem.OuSelectViewStyle.Style2).ToString() %>', '<%=((int)Honestysoft.Baseframework.Model.EnumItem.OuSelectMode.Single).ToString() %>', '<%=((int)Honestysoft.Baseframework.Model.EnumItem.OuSelectTarget.Full).ToString() %>', '<%=((int)Honestysoft.Baseframework.Model.EnumItem.OuSelectNodeType.Company).ToString() %>', '<%=txtContractor.ClientID %>', '<%=hidContractor.ClientID %>');
	        return false;
	    }
	    function doConfirm() {
	        var arrId = new Array();
	        arrId[0] = '<%=Request["ID"]+"" %>';
	        var retValue = window.showModalDialog('ContractConfirm.aspx', arrId, 'dialogHeight=500px;dialogWidth=560px;help=no;scrollbars=no;status=no');
	        if (typeof (retValue) != "undefined" && retValue != null && retValue) {
	            return true;
	        }
	        return false;
	    }
	    function viewConfirm() {
	        var arrId = new Array();
	        arrId[0] = '<%=Request["ID"]+"" %>';
	        var retValue = window.showModalDialog('ContractConfirm.aspx', arrId, 'dialogHeight=500px;dialogWidth=560px;help=no;scrollbars=no;status=no');
	        return false;	        
	    }
    </script>
<script language="javascript" type="text/javascript">
        var opts = null;
        function InitRules() {
            opts = {
                 rules:
                 {
					<%= txtProject.UniqueID%>:{required: true},
					<%= ddlContractCategory.UniqueID%>:{required: true},
					<%= txtCode.UniqueID%>:{required: true,maxlength: 200},
					<%= txtName.UniqueID%>:{required: true,maxlength: 200},
					<%= numTotalPrice.UniqueID%>:{required: true,number: true},
					<%= txtContractor.UniqueID%>:{required: true}					
                 },
                 messages:
                 {
					<%= txtProject.UniqueID%>:{required: "所属项目 请选址合适的值"},
					<%= ddlContractCategory.UniqueID%>:{required: "合同类别 请选择合适的值"},
					<%= txtCode.UniqueID%>:{required: "合同编号 请输入合适的值",maxlength: "合同编号 最多只能输入200个字符"},
					<%= txtName.UniqueID%>:{required: "合同名称 请输入合适的值",maxlength: "合同名称 最多只能输入200个字符"},
					<%= numTotalPrice.UniqueID%>:{required: "合同总价 请输入合适的值",number: "合同总价 请输入有效的数字"},
					<%= txtContractor.UniqueID%>:{required: "施工单位 请输入合适的值"}					
                 },
                 onfocusout:false,
                 onclick:false,
                 onkeyup:false,
                 errorPlacement: function(error, element) {
                    $("#errorContainer").show();
                    error.html("<li>* "+error.html()+"</li>");
                    error.appendTo("#errorContainer");
                 },
                 wrapper:"li"
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit" style="border-bottom:0px;margin-top:2px;">
            <th style="border-bottom:0px">合同信息维护</th>
        </table>
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit">
          <tr style="display:none">
            <td style="width:120px;" ></td><td></td><td style="width:120px;" ></td><td></td>
          </tr>
		<tr>
			<td class="title1">所属项目</td>
			<td colspan="3">
                <asp:HiddenField runat="server" ID="hidProjectID" />
            <asp:TextBox ID="txtProject" runat="server" ReadOnly="true"  cssClass="input2" MaxLength="36" Width="98%"></asp:TextBox></td>
			
		</tr>
		<tr>
            <td class="title1" >合同编号</td>
			<td><asp:TextBox ID="txtCode" runat="server"  cssClass="input2" MaxLength="200" Width="96%"></asp:TextBox></td>
            <td class="title1" >合同类别</td>
			<td><asp:DropDownList ID="ddlContractCategory" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
			
		</tr>
        <tr>
            <td class="title1">合同名称</td>
			<td colspan="3"><asp:TextBox ID="txtName" runat="server"  cssClass="input2" MaxLength="200" Width="98%"></asp:TextBox></td>
        </tr>
		<tr>
			<td class="title1">合同总价(元)</td>
			<td><asp:TextBox ID="numTotalPrice" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
			<td class="title1">(包含预留金(元))</td>
			<td><asp:TextBox ID="numReserveAmount" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
		</tr>        
		<tr>
            <td class="title1">变更后总价(元)</td>
			<td>            
            <asp:TextBox ID="numChangePrice" Enabled="false" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox>
            <asp:HiddenField runat="server" ID="hidChangePrice" />
            </td>

			<td class="title1">签订日期</td>
			<td><asp:TextBox ID="dtpSignDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
		
		</tr>
		<tr>
			<td class="title1">施工单位</td>
			<td colspan="3"><asp:TextBox ID="txtContractor" runat="server" ReadOnly="true"  cssClass="input2" MaxLength="36" Width="86%"></asp:TextBox>
            <asp:HiddenField ID="hidContractor" runat="server" />
                <asp:Button runat="server" ID="btnSelect2" Text="选择" OnClientClick="SelectContractor();return false;" class="btn_small_normal" 
                onmouseover="this.className='btn_small_active'" 
                onmouseout="this.className='btn_small_normal'" />
            </td>
		</tr>
        <tr>
            <td class="title1">开户银行</td><td><asp:TextBox runat="server" ID="txtBankName" MaxLength="200" cssClass="input2" Width="96%"></asp:TextBox> </td>
            <td class="title1">收款账号</td><td><asp:TextBox runat="server" ID="txtBankAccount" MaxLength="200" cssClass="input2"  Width="96%"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="title1">付款条件</td>
            <td colspan="3">
            <FCKeditorV2:FCKeditor ID="FCKeditor2" BasePath="../../fckeditor/" ToolbarSet="Custom3" runat="server" Width="630px" Height="250px">
            </FCKeditorV2:FCKeditor>
            </td>
        </tr>
		<tr>
			<td class="title1">备注</td>
			<td colspan="3"><asp:TextBox ID="txtRemark" runat="server"  cssClass="input2" TextMode="MultiLine" Rows="10" Width="98%"></asp:TextBox></td>
			
		</tr>
        </table>
        
        <div class="save_area">
        <asp:Button runat="server" ID="btnConfirm" Text="确认初始化"  style="display:none" OnClientClick="javascript:return doConfirm();" 
         class="btn_big_normal" onmouseover="this.className='btn_big_active'" 
            onmouseout="this.className='btn_big_normal'" onclick="btnConfirm_Click" />
            <asp:Button runat="server" ID="btnViewConfirm" Text="查看确认意见" style="display:none"   OnClientClick="javascript:viewConfirm();return false;" 
         class="btn_big_normal" onmouseover="this.className='btn_big_active'" 
            onmouseout="this.className='btn_big_normal'" />
            <asp:Button runat="server" ID="btnOK" Text="确定" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" onclick="btnOK_Click"/>
            <input type="button" id="btnExit" value="取消" onclick="javascript:window.returnValue=false;window.close();" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        </div>
        <asp:HiddenField runat="server" ID="hidCreator" />
        <asp:HiddenField runat="server" ID="hidCreateTime" />
        <asp:HiddenField runat="server" ID="hidID" />
        <asp:HiddenField runat="server" ID="hidIsInit" />
        <asp:HiddenField runat="server" ID="hidConfirmUser" />
        <asp:HiddenField runat="server" ID="hidConfirmOpinion" />
        <asp:HiddenField runat="server" ID="hidConfirmTime" />
        <asp:HiddenField runat="server" ID="hidSortCode" />
</asp:Content>


